home *** CD-ROM | disk | FTP | other *** search
- Path: osuunx.ucc.okstate.edu!kakani
- From: kakani@osuunx.ucc.okstate.edu (Madhav Kakani)
- Newsgroups: comp.lang.c++
- Subject: How to generate all the combinations of n numbers?
- Date: 22 Feb 1996 23:31:21 GMT
- Organization: Oklahoma State University, Stillwater OK
- Message-ID: <4giuc9$pq@news.cis.okstate.edu>
- NNTP-Posting-Host: osuunx.ucc.okstate.edu
-
- Hello everybody,
- I am having problems in writing a c/c++ program which
- generates all possible combinations of n given numbers.
- For example, if an array x has some numbers
-
- int x[] = {1,2,3};
-
- the program should generate the following output:
- 1
- 2
- 3
- 12
- 13
- 23
- 123
-
- Thanks in advance,
- -madhav
-
-